import store from 'store';
import environment from '@/environment';
import IHelper from './helper.service';

const IStorage = new class {
  keys = {
    USER_TICKET: IHelper.md5(`${environment.mode}_USER_TICKET`),
  }

  getUserTicket(): string {
    const key = this.keys.USER_TICKET;
    return store.get(key, "")
  }

  setUserTicket(token: string): void {
    store.set(this.keys.USER_TICKET, token);
  }
  removeUserToken(): void {
    store.remove(this.keys.USER_TICKET);
  }
}

export default IStorage;
